package leetcodecompetition.D336;

import org.junit.jupiter.api.Test;

public class T6315 {
    public int vowelStrings(String[] words, int left, int right) {
        int sum=0;
        for (int i = left; i <=right ; i++) {
            if (isvowelString(words[i])){
                sum++;
            }
        }
        return sum;

    }
    public boolean isvowelString(String str){
        char[] chars={'a','e','i','o','u'};
        char a=str.charAt(0);
        char b=str.charAt(str.length()-1);
        for(char c:chars){
            if (a==c){
                for(char c2:chars){
                    if (b==c2){
                        return true;
                    }
                }
            }
        }
        return false;
    }

    @Test
    public void test() {

        String[] str={"are","amy","u"};
        ;
        System.out.println(isvowelString("are"));
        System.out.println(vowelStrings(str,0,2));

    }
}
